import request from '@/utils/request'

// 查询协议驱动列表
export function listDriver(query) {
  return request({
    url: '/equipment/driver/list',
    method: 'get',
    params: query
  })
}
// 查询协议驱动列表
export function listDriverAll(query) {
  return request({
    url: '/equipment/driver/listAll',
    method: 'get',
    params: query
  })
}
// 查询协议驱动详细
export function getDriver(id) {
  return request({
    url: '/equipment/driver/' + id,
    method: 'get'
  })
}

// 新增协议驱动
export function addDriver(data) {
  return request({
    url: '/equipment/driver',
    method: 'post',
    data: data
  })
}

// // 新增协议驱动
// export function addAttribute(data,id) {
//   return request({
//     url: '/equipment/driver/add?id=' + id,
//     method: 'post',
//     data: data
//   })
// }
// 修改协议驱动
export function updateDriver(data) {
  return request({
    url: '/equipment/driver',
    method: 'put',
    data: data
  })
}

// 删除协议驱动
export function delDriver(id) {
  return request({
    url: '/equipment/driver/' + id,
    method: 'delete'
  })
}

// 导出协议驱动
export function exportDriver(query) {
  return request({
    url: '/equipment/driver/export',
    method: 'get',
    params: query
  })
}
// 查询协议驱动属性
export function attribute(driverId) {
  return request({
    url: '/equipment/driver/attribute?driverId=' +driverId,
    method: 'get',
  })
}

export function delAttribute(attid) {
  return request({
    url: '/equipment/driver/delAttribute?attid=' +attid,
    method: 'delete',
  })
}

